{{include template('public/header','admin')}}
<body>
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h3>{{$modelname}}{{L('content')}}</h3>
                    <div class="opt-btn">
                        <a href="{{$manage_url}}" class="btn btn-primary bar-btn">
                            <i class="fa fa-fw fa-plus"></i>{{L('add')}}
                        </a>
                    </div>
                </div>
                <div class="search">
                    <div class="well">
                        <form class="form-inline" action="{{url()}}" method="get"  id="search">
                            <div class="form-group">
                                <label for="modelid">{{L('content_modelid')}}</label>
                                {{showsitemodel(ticky\request::get('modelid', 0),'modelid',true)}}
                            </div>
                            <div class="form-group">
                                <label>{{L('content_catid')}}</label>
                                {{select_category('catid', ticky\request::get('catid', 0), '内容分类', 0, '', true, true, ticky\request::get('modelid', 0))}}
                            </div>
                            <div class="form-group">
                                <label>{{L('content_updatetime')}}</label>
                                <input type="text" name="startdate" class="calendar-icon form-control" value="{{ticky\request::get('startdate','')}}" style="width:110px;" onclick="showcalendar(event, this)"   />
                                <input type="text" name="enddate" class="calendar-icon form-control" value="{{ticky\request::get('enddate','')}}" style="width:110px;" onclick="showcalendar(event, this, false)"  />
                            </div>
                            <div class="form-group">
                                <label>{{L('keyword')}}</label>
                                <input type="text" name="title" class="form-control" value="{{ticky\request::get('title','')}}">
                            </div>
                            <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i>{{L('search')}}</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <form method="post" action="/admin/content/batchremove" class="form-inline" role="form">
                    <table id='ContentList' class="table table-condensed table-hover table-striped tablesorter table-fixed table-selectable">
                        <thead>
                            <tr>
                                <th style="width: 15px;"><input type="checkbox" name="chk" class="checkbox" onclick="checkAll('prefix', this.form, 'ids', 'chk')" /></th>
                                <th>{{L('content_title')}}</th>
                                <th>{{L('content_catid')}}</th>
                                <th>{{L('content_allowcomment')}}</th>
                                <th>{{L('content_views')}}/{{L('content_replies')}}</th>
                                <th>{{L('content_is_push')}}</th>
                                <th>{{L('content_status')}}</th>
                                <th>{{L('content_updatetime')}}</th>
                                <th>{{L('edit')}}</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{foreach $items as $item}}
                            <tr>
                                <td><input type="checkbox" class="checkbox" name="ids[]" value="{{$item.contentid}}" /></td>
                                <td style="text-align: left;"><a href="{{$item.url}}" target="_blank" >{{cutstr($item.title,100)}}</a>{{$item.level}}</td>
                                <td catid="{{$item.catid}}" >{{$item.catname}}</td>
                                <td>{{update_status('/admin/content','content','contentid',$item.contentid,'allowcomment',$item.allowcomment)}}</td>
                                <td >{{$item.views}}/{{$item.replies}}</td>
                                <td >{{$item.is_push}}</td>
                                <td >{{update_status('/admin/content','content','contentid',$item.contentid,'status',$item.status)}}</td>
                                <td >{{date("Y-m-d H:i:s",$item.updatetime)}}</td>
                                <td style="width: 15%">
                                    <a href="{{$item.edit_url}}" class="btn btn-warning btn-xs" >{{L('edit')}}</a>
                                    <a  href="{{$item.del_url}}" type="button" class="btn btn-danger btn-xs" >{{L('delete')}}</a>
                                </td>
                            </tr>
                            {{/foreach}}
                        </tbody>
                        <tr>
                            <td colspan="15">
                                <div class="form-inline " style="text-align: left;">
                                    <div  style="float: left;">
                                        <input type="checkbox" name="chkall" class="checkbox" onclick="checkAll('prefix', this.form, 'ids')" />{{L('chkall')}}
                                        <input type="radio" class="radio" id="optype_outer" name="optype" value="del" />{{L('delete')}}
                                        <input type="radio" class="radio" id="optype_outer" name="optype" value="baidu" />{{L('content_is_push')}}
                                        <input type="submit" class="btn" name="sendsubmit" value="{{L('submit')}}" />
                                    </div>
                                    <div  style="float:right;">
                                        {{include template('public/page','admin')}}
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        function change_model() {
            $("#search").submit();
        }

        function baidu_push() {
            var ids = $("input[name='ids[]']:checked");
            if (ids.length < 1) {
                layer.alert('请勾选信息！');
                return false;
            }
            document.getElementById('myform').action = '/admin/content/baidu_push.html';
            document.getElementById('myform').submit();
        }
    </script>
</body>
</html>



